package cn.common.springmvc;

import org.springframework.beans.propertyeditors.CustomNumberEditor;

public class CustomNumberEditorEx extends CustomNumberEditor {

	public CustomNumberEditorEx(Class<? extends Number> numberClass,boolean allowEmpty) throws IllegalArgumentException {
		super(numberClass, allowEmpty);
	}
	
	@Override
	public void setAsText(String text) throws IllegalArgumentException
	{
		try{
			super.setAsText(text);
		}catch(IllegalArgumentException e){
			super.setAsText("0");
		}
	}
}
